package com.villaday.idf.adapter3;

import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.base.OnAdapterCallbackListener;
import com.villaday.idf.custom.foldtext.FoldTextView;
import com.villaday.idf.model.Member_collect_listEntity;
import com.villaday.idf.model.RefreshtokenEntity;
import com.villaday.idf.model3.Vips_brokerage_recordsEntity;
import com.villaday.idf.util.SharedPreferencesUtil;
import com.zhy.view.flowlayout.FlowLayout;
import com.zhy.view.flowlayout.TagAdapter;
import com.zhy.view.flowlayout.TagFlowLayout;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

import byc.imagewatcher.MessagePicturesLayout;

/**
 * 提现记录
 */

public class TixianJiluAdapter extends AbsRecyclerViewAdapter<Vips_brokerage_recordsEntity.BodyBean.ListBean> {
    private OnAdapterCallbackListener onAdapterCallbackListener;
    private View.OnClickListener onClickListener;
    private MessagePicturesLayout.Callback mCallback;


    public TixianJiluAdapter(Context context, OnAdapterCallbackListener onAdapterCallbackListener) {
        super(context, R.layout.item_tixian_jilu, /*R.layout.item_dynamic_1, R.layout.item_dynamic_2,*/ R.layout.item_page_loading,
                R.layout.item_page_bottom);
        this.onAdapterCallbackListener = onAdapterCallbackListener;


    }


    @Override
    public int getItemType(Vips_brokerage_recordsEntity.BodyBean.ListBean d) {
        return d.getMyType();
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, Vips_brokerage_recordsEntity.BodyBean.ListBean d, int position) {
        switch (d.getMyType()) {
            case 0: {
holder.bindTextView(R.id.tv_title,d.getTitle())
        .bindTextView(R.id.tv_time,d.getCreateTime())
        .bindTextView(R.id.tv_num,d.getType()==1?"+"+d.getAmountValue():"-"+d.getAmountValue());
                TextView view = (TextView) holder.getView(R.id.tv_num);
                view.setTextColor(d.getType()==1? Color.parseColor("#F77172"):Color.parseColor("#333333"));

            }
            break;

            case 1: {
                onAdapterCallbackListener.onCallback();
            }
            break;


        }
    }
}
